import React, { Component } from "react";
import Proptypes from "prop-types";

import Item from "./item";
class List extends Component {
  static propTypes = {
    comments: Proptypes.array.isRequired,
  };
  render() {
    const { comments } = this.props;
    return (
      <div>
        <h2>评论回复</h2>
        {comments.map((comment, index) => {
          return <Item key={index} comment={comment} index={index} />;
        })}
      </div>
    );
  }
}

export default List;
